<?php
class App_Module_Admin_Component_Groups_Tpl_Form_Field_Group extends App_Tpl_Form_Field_Select
{
    protected function RenderField()
    {
    	$obj = Mozg_Registry::Get('groupObject');
    	
	    if ($obj->GetId())
		{
			$unsGroups = Mozg_Mapper::Get('Groups')->GetList(array('parentId' => $obj->GetId(), 'levels' => 100));
			$unsGroups[$obj->GetId()] = $obj;
			$this->params['values'] = array_diff_key($this->params['values'], $unsGroups);
		}
    	
    	return parent::RenderField();
    }
}